package puntaelena.facilitylocation.hillclimbing.experiment.observeneighbors;

import laboratoryQ.experiment.reportage.IReportageData;
import laboratoryQ.experiment.reportage.ui.diagram2component.IDiagramsExtractor;
import laboratoryQ.experiment.reportage.ui.diagram2component.ITitlesExtractor;
import laboratoryQ.experiment.settings.ISettingsContainer;
import laboratoryQ.experiment.settings.ReflectionBasedSettingsContainer;
import puntaelena.graphsupport.GraphSupportFront;
import puntaelena.graphsupport.solver.IFacilityLocationSolver;

public class VariateNeighborsCountReportageData implements IReportageData {
	private static final String[] SETTINGS_FIELDS_NAMES = {
		"randomSeed",
		
		"citiesCount",
		"facilitiesCount",
		
		"neighborCountBeg",
		"neighborCountEnd",

		"cheapEdgeBeg",
		"cheapEdgeRange",
		"expensiveEdgeBeg",
		"expensiveEdgeRange",
		"facilityPriceBeg",
		"facilityPriceRange"
	};
	
	
// TODO: rename VariateNeighborsCountReportageData

	private FacilitiesDiagramExtractor diagramsExtractor = new FacilitiesDiagramExtractor();
	private String experimentTitle = "Neigh-count-observe";
	private ReflectionBasedSettingsContainer settingsContainer;
	private ITitlesExtractor titlesExtractor = diagramsExtractor;

	public VariateNeighborsCountReportageData() {
//### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ###
		PuntaElenaExperimentSettings settings = new PuntaElenaExperimentSettings();
		settings.initialise();

		settings.citiesCount = 100;
		settings.facilitiesCount = 10;
		settings.citiesCountBig = 300;
		settings.facilitiesCountBig = 50;

		settings.graphGenerator = GraphSupportFront.expensiveCheapGenerator();
		settings.neighborCountBeg = 2;
		settings.neighborCountEnd = 15;
		settings.neighborCountBegBig = 10;
		settings.neighborCountEndBig = 50;

		settings.cheapEdgeBeg = 100;
		settings.cheapEdgeRange = 50;
		settings.expensiveEdgeBeg = 150;
		settings.expensiveEdgeRange = 50;
		settings.facilityPriceBeg = 300;
		settings.facilityPriceRange = 200;

		settings.randomSeed = 4045;

		settings.testingSolvers = new IFacilityLocationSolver[] {
			GraphSupportFront.getBinarySolver(),
			GraphSupportFront.getTrivialSolver(),
			GraphSupportFront.getFactor3Solver()
		};

		settings.validate();
//### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ###
		settingsContainer =
			new ReflectionBasedSettingsContainer(settings);
		settingsContainer.sortFields(
			SETTINGS_FIELDS_NAMES
		);
//### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ###
	}

	@Override
	public IDiagramsExtractor getDiagramsExtractor() {
		return diagramsExtractor;
	}

	@Override
	public String getExperimentTitle() {
		return experimentTitle;
	}

	@Override
	public ISettingsContainer getSettingsContainer() {
		return settingsContainer;
	}

	@Override
	public ITitlesExtractor getTitlesExtractor() {
		return titlesExtractor;
	}
}
